package langchain4j.hsl.com.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 非持久化对话助手配置，存储在内存中
 * Created by hsl on 2025/4/25.
 */
@Configuration
public class ChatMemoryConfig {
    @Bean
    ChatMemory chatMemory() {
        return MessageWindowChatMemory.withMaxMessages(10);
    }
}
